const KEY = 'my-token-DaShiJian-pc'
const userKEY = 'my-userInfo-DaShiJian-pc'
// 获取
export const getToken = () => {
  return localStorage.getItem(KEY)
}

// 设置
export const setToken = (newToken) => {
  localStorage.setItem(KEY, newToken)
}

// 删除
export const delToken = () => {
  localStorage.removeItem(KEY)
}

// 获取数据
export const getuserInfo = () => {
  const userInfo = JSON.parse(sessionStorage.getItem(userKEY))
  return userInfo
}
// 设置数据
export const setuserInfo = (obj) => {
  const userInfoJSon = JSON.stringify(obj)
  return sessionStorage.setItem(userKEY, userInfoJSon)
}
